package com.qinggeng.framework.config.mq.impl;

import com.alibaba.fastjson.JSONObject;
import com.qinggeng.framework.config.mq.dto.MessagePresaleDTO;
import com.qinggeng.framework.config.mq.handle.MessageHandle;
import com.qinggeng.project.system.service.IGoodsPresaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 吴鹏飞
 * @date 2020/11/29
 */
@Component
public class PresaleHandleImpl implements MessageHandle {
    @Autowired
    private IGoodsPresaleService goodsPresaleService;


    @Override
    public void handle(String msg) {
        MessagePresaleDTO messagePresaleDTO = JSONObject.parseObject(msg, MessagePresaleDTO.class);
        goodsPresaleService.updateGoodsPresaleGoodsType(messagePresaleDTO);
    }
}
